﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BankRemoteSystem.GUI
{
    public partial class frmMain : Form
    {
        Entities.User user;
        public frmMain(Entities.User us)
        {
            InitializeComponent();
            this.user= us;
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            lblName.Text = user.FullName;
            lblAddress.Text = user.Address;
            lblEmail.Text = user.Email;
            lblGender.Text = user.Gender.ToString();
            lblTelephone.Text = user.Telephone;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (cboAccount.SelectedIndex == 0)
            {
                frmInfo fm = new frmInfo(user, 1);
                fm.MdiParent = this.MdiParent;
                fm.WindowState = FormWindowState.Maximized;
                //this.Close();
                fm.Show();
            }
            else if (cboAccount.SelectedIndex == 1)
            {
                frmInfo fm = new frmInfo(user, 0);
                fm.MdiParent = this.MdiParent;
                //this.Close();
                fm.WindowState = FormWindowState.Maximized;
                fm.Show();
            }
            else if (cboAccount.SelectedIndex == 2)
            {
                frmInfo fm = new frmInfo(user, 2);
                fm.MdiParent = this.MdiParent;
                //this.Close();
                fm.WindowState = FormWindowState.Maximized;
                fm.Show();
            }
        }
    }
}
